package ca.scotthyndman.as2haxe.dom.binding;

import ca.scotthyndman.as2haxe.dom.ASSimpleName;

/**
 * Implemented by bindings that represent elements that can be renamed.
 */
public interface IRenamableBinding extends IBinding {

	/**
	 * Renames the bound element, all all elements that refer to it. Please note
	 * that the new binding key should not be set internally.
	 * 
	 * @param newName
	 *            the new name
	 * @return the new key for the binding
	 * @throws Exception
	 *             if the bound element's parent already contains an element
	 *             with that name
	 */
	public String rename(ASSimpleName newName) throws Exception;
}
